home *** CD-ROM | disk | FTP | other *** search
- this.heartA = new Array();
- this.createHeartFlakes = function()
- {
- var t = this;
- var i = 1;
- while(i < 10)
- {
- t.bg.attachMovie("heart","h" + i,i);
- var n = t.bg["h" + i];
- n._x = random(t.stageW);
- n._y = random(t.stageH);
- n._xscale = n._yscale = random(200) + 400;
- n._alpha = 15;
- n._rotation = random(60) - 30;
- n.w2 = n._width / 2;
- n.h2 = n._height / 2;
- n.mx = Math.random() * 2 - 1;
- n.typ = "hf";
- t.heartA.push(n);
- i++;
- }
- };
- this.createHeart = function()
- {
- var t = this;
- t.attachMovie("heart","h" + t.hd,t.hd);
- var n = t["h" + t.hd];
- n._y = (- n._height) / 2;
- n._xscale = n._yscale = t.heartSize;
- n.typ = "heart";
- t.htim = 0;
- if(t.comboCount == 0)
- {
- if(t.gameType == "real")
- {
- n._x = random(t.stageW - t.startX) + t.startX - n._width / 2;
- }
- else
- {
- n._x = t.startX + random(80) + 30;
- }
- var distB = 0.15 * Math.round((point.x - t.startX) / t.heartStageW);
- n.my = Math.random() * 0.6 + 0.25 + t.timer / 20000 - distB;
- var c = t.timer / 300;
- t.hdel = 150 - c - random(30);
- if(t.hdel < 0)
- {
- t.hdel = 20;
- }
- }
- else
- {
- t.hdel = 35 - 2 * t.comboCount - t.timer / 300;
- n._x = t.comboCount * 50 + t.startX - 90;
- n._xscale = n._yscale = 130;
- n.my = 0.4 + t.timer / 20000;
- t.comboCount = t.comboCount + 1;
- if(t.comboCount > 10)
- {
- t.comboCount = 0;
- t.gameDisplay.p6._alpha = t.initPUAlpha;
- }
- }
- t.addD("h");
- t.heartA.push(n);
- };
- this.moveH = function()
- {
- var t = this;
- var i = t.heartA.length - 1;
- while(i >= 0)
- {
- var n = t.heartA[i];
- n._y += t.hmyc * n.my;
- if(n.typ == "hf")
- {
- n._x += n.mx;
- if(t.grav != 0)
- {
- n.my = Math.random() * 2 + t.grav;
- }
- else
- {
- n.my = 0;
- }
- if(n._y > t.stageH + n.h2)
- {
- n._x = random(t.stageW);
- n._y = - n.h2;
- n._xscale = n._yscale = random(200) + 400;
- n._alpha = 20;
- n._rotation = random(60) - 30;
- n.w2 = n._width / 2;
- n.h2 = n._height / 2;
- n.mx = Math.random() * 2 - 1;
- }
- if(n._x < - n.w2)
- {
- n._x = t.stageW + n.w2;
- }
- else if(n._x > t.stageW + n.w2)
- {
- n._x = - n.w2;
- }
- }
- else if(n.typ == "heart")
- {
- if(n._y > t.stageH - n._height / 2)
- {
- n._y = t.stageH - n._height / 2;
- t.numLives--;
- t.gameDisplay["h" + t.numLives]._visible = false;
- if(t.soundPlay == "true")
- {
- t.breakSound.start();
- }
- t.attachMovie("shatter","s" + t.hd,t.hd);
- var m = t["s" + t.hd];
- m._xscale = m._yscale = n._xscale;
- m._x = n._x;
- m._y = n._y;
- t.addD("h");
- n.removeMovieClip();
- t.heartA.splice(i,1);
- if(t.numLives == 0)
- {
- t.gameOverFunc();
- }
- }
- }
- else if(n.typ == "pu")
- {
- if(n._y > t.stageH + n._height / 2)
- {
- n.removeMovieClip();
- t.heartA.splice(i,1);
- }
- }
- else if(n.typ == "fly")
- {
- n._x += t.hmyc * n.my;
- }
- i--;
- }
- };
-